var menu=$('#header #example-navbar-collapse li.menu');

var submenu=$('#header #example-navbar-collapse li.menu ul.wrap');

submenu.css('display','none');

menu.mousemove(
	function () {
		$(this).find('.wrap').slideDown();
		$(this).siblings().find('.wrap').css('display','none');
	}
);

menu.mouseleave(
	function () {
		submenu.css('display','none');
	}
);



var div=$('.our-member .data-item div');
var p=$('.our-member .data-item p');
var timer_number=setInterval(fun_number,1000);

div.mousemove(
	function () {
		$(this).siblings('p').css('display','block');
		clearInterval(timer_number);
	}
);

div.mouseout(
	function () {
		p.css('display','none');
		timer_number=setInterval(fun_number,1000);
	}
);

function Student(id,name,hometown,title,img,motto) {
	this.id=id;
	this.name=name;
	this.hometown=hometown;
	this.title=title;
	this.img=img;
	this.motto=motto;
}
var s1=new Student(1,'陈用群','温州','学生会','pic/1.jpg','好好学习，天天向下');
var s2=new Student(2,'郑良靖','温州','学生会','pic/2.jpg','好好学习，天天向下');
var s3=new Student(3,'杨翌','温州','学生会','pic/3.jpg','好好学习，天天向下');
var s4=new Student(4,'陈一颖','温州','学生会','pic/4.jpg','好好学习，天天向下');
var s5=new Student(5,'陶伟','温州','学生会','pic/5.jpg','好好学习，天天向下');
var s6=new Student(6,'夏阳','温州','学生会','pic/6.jpg','好好学习，天天向下');
var s7=new Student(7,'潘益婷','温州','学生会','pic/7.jpg','好好学习，天天向下');
var s8=new Student(8,'宋琦豪','温州','学生会','pic/8.jpg','好好学习，天天向下');
var s9=new Student(9,'李家辉','温州','学生会','pic/9.jpg','好好学习，天天向下');
var s10=new Student(10,'丁振铮','温州','学生会','pic/10.jpg','好好学习，天天向下');
var s11=new Student(11,'宝宝','温州','学生会','pic/11.jpg','好好学习，天天向下');
var s12=new Student(12,'赫赫','温州','学生会','pic/12.jpg','好好学习，天天向下');
var s13=new Student(13,'baby','温州','学生会','pic/13.jpg','好好学习，天天向下');
var yd1701=[s1,s2,s3,s4,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13]

function fun_number () {
	for (var i = 0; i < 3; i++) {
		var r=Math.floor((Math.random()*13));
		var img=yd1701[r].img;
		var motto=yd1701[r].motto;
		var intro=yd1701[r].title+":"+yd1701[r].name+","+yd1701[r].hometown;
		div.eq(i).find('img').attr('src',img);
		p.eq(i).text(motto);
		p.eq(i).siblings('h4').text(intro);
	}
}

var event_item=$('.our-event .data-item div');
event_item.mouseleave(
	function() {
		$(this).css('background-color','white');
		$(this).find('span').css('color','dodgerblue');
		$(this).find('h3').css('color','darkgray');
		$(this).find('h4').css('color','dodgerblue');
	}
);

event_item.mousemove(
	function() {
		$(this).css('background-color','dodgerblue');
		$(this).children().css('color','white');
	}
);

var course_li=$('.our-course .data-course li.card-item');
course_li.mousemove(
	function() {
		$(this).attr('class','card-item card-active');
		$(this).siblings().attr('class','card-item');
	}
);


 var headr_input=$('#header #myInput');
  var header_li=$('#header ul.mycourse li');
  headr_input.keyup(
  	function(){  		
  		for(var i=0;i<header_li.length;i++){
  			// li内容
  			var value_li=header_li.eq(i).text().toLocaleLowerCase();
  			// input输入内容
  			var value_input=headr_input.val().trim().toLowerCase();
  			// 判断是否包含
  			if(value_li.indexOf(value_input)>-1){
  				header_li.eq(i).css('display','block');
  			}else{
  				header_li.eq(i).css('display','none');
  			}
  		}
  	}
  );
  